The SixBit Application Programming Interface > API Call Reference > Selecting Output Fields with a Map File |
By default, any calls requesting a list of records will return all elements of the class requested. For example, the Items_List call will return all Item fields in the Item element. To return only select fields in the output, a Map file may be used.
Map files are simply a way to define a list of fields. Users who have used the CSV import/export in SixBit will already have experience with Map files. During a CSV import or export, once fields are mapped from an input file or output file the mapping can be saved in a map file for re-use later. It is this same Map file that the API takes advantage of to limit the fields returned from an API call.
Creating a Map File
The simplest way to create a Map file is to use the CSV Export window in SixBit. For example, to create a map file for an Items_List call, you could export an item to a CSV file, during the export, you would select the fields you want to export and then save them as a Map file. See Exporting to a Comma Separated Values Flat File in the User's Guide for more info on creating the Map file.
Using the Map File
Once it is created, the map file can be used to limit the output of a list command simply by placing the path to the mapfile in the MapFilePath parameter on the API call.